package yhao.infra.feature.alipay;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import yhao.infra.feature.alipay.core.AliPayService;
import yhao.infra.feature.alipay.core.config.AliPayConfig;
import yhao.infra.feature.alipay.core.config.YhaoAlipayProperties;

@Import(YhaoAlipayConfig.class)
public class Demo {
    @Bean(name="aliPayService")
    public AliPayService alipayService(YhaoAlipayProperties properties){
        AliPayConfig config = properties.getConfig().get("demo");
        AliPayService aliPayService = new AliPayService(config);
        return aliPayService;
    }
}
